//联合类型
let a:string | number = 'hello'
a = 123

let b:string | number | boolean = 'hello'
b = true

//交叉类型
type A = {
    username:string
}
type B = {
    age:number
}

//A或B
let c1:A|B = {
    username:'xiaoming',
}

//A并B
let c2:A&B = {
    username:'xiaoming',
    age:20
}

console.log(c1)
console.log(c2)